home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / develop / ad2mac.arc / TEST11.ASM < prev    next >
Assembly Source File  |  1989-07-27  |  2KB  |  121 lines

  1.     ttl    HC11 Test Program for AD2MAC
  2. *  Test Program for AD2MAC Utility
  3. *  Extracts symbol info from 2500AD cross 68HC11 assembler
  4. *  listing file (.LST) and produces HDS-300 compatible
  5. *  macro file (.MAC) containing local symbol (LS) commands.
  6. *
  7. *  BY:  Peter S. Gilmour    27 July 1989
  8.  
  9. control    equ    $103
  10. srmask    equ    $80
  11. fcbase    equ    $204
  12. stmask    equ    $40
  13. pattern    equ    $aa
  14. shram    equ    $200
  15. jmp1    equ    $307
  16. jmp1_addr equ    jmp1+$1c
  17.  
  18.     .absolute
  19.     org    $50
  20. count    rmb    1        Command count
  21.     .relative
  22.     org    shram
  23.     rmb    $20
  24. addr    rmb    2        Command address
  25. get    rmb    2        Get data address
  26. data    rmb    80        Command data
  27.     rmb    100
  28. stack    equ    *-1        Stack area
  29.     page
  30.  
  31.     org    $800
  32.  
  33. * Here for power up/reset:
  34. start    ldaa    control
  35.     anda    #stmask        If not power up, then
  36.     beq    config        .  enter exec via config cmd!
  37.  
  38. * Here for self-test:
  39. stest    ldab    #0
  40.     ldaa    #pattern
  41.     ldx    #shram
  42. st_100    staa    ,x        Test 1st page of shared ram.
  43.     cmpa    ,x
  44.     bne    st_err1        Exit if error!
  45.     coma            Get inverse pattern
  46.     bpl    st_100        and test same location again!
  47.     incb
  48.     beq    st_100        Continue until entire page is tested!
  49.  
  50.     bra    exec        Enter executive loop.
  51.  
  52. * Here for self-test error:
  53. st_err1 ldd    #shram
  54.     bra    *        Hang the system.
  55.     page
  56.  
  57. * Here for config command:
  58. config    ldaa    control
  59.     staa    shram
  60.     nop
  61. * Fall into the exec loop!
  62.  
  63. * Here for the executive command loop:
  64. exec    lds    #stack        Reset stack pointer.
  65.     ldaa    control
  66.     oraa    #srmask
  67.     staa    control        Yield shared ram to FIM.
  68.  
  69. ex$wait    ldaa    control
  70.     anda    #srmask
  71.     bne    ex$wait        Wait for FIM to return shared ram.
  72.  
  73.     ldaa    fcbase        Get cmd word and verify it, else
  74.     bne    exec        .  ignore it!
  75.     ldab    fcbase+1
  76.     cmp    #maxfc+1
  77.     bhs    exec
  78.  
  79.     lslb            Get addr of proper routine from table
  80.     ldx    #ftabl        and place into X register.
  81.     abx    
  82.  
  83.     jsr    ,x        Go execute the command.
  84.     bra    exec        Return to exec loop.
  85.  
  86. ftabl    fdb    rduser
  87.     fdb    wruser
  88. maxfc    equ    ((*-ftabl)/2)-1        Maximum legal function code
  89.     page
  90.  
  91. * Here for read user memory command:
  92. rduser    jsr    cmd.init
  93.  
  94. rduser1 ldaa    0,x
  95.     staa    data
  96.     inx
  97.     inc    count
  98.     bne    rduser1
  99.  
  100.     rts
  101.  
  102. * Here for write user memory command:
  103. wruser    jsr    cmd.init
  104.  
  105. wruser1 ldaa    data
  106.     staa    ,x
  107.     inx
  108.     inc    count
  109.     bne    wruser1
  110.  
  111.     rts
  112.  
  113. * Subr. to init for command execution:
  114. cmd.init ldaa    addr
  115.     staa    get
  116.     ldaa    addr+1
  117.     staa    get+1
  118.     rts
  119.  
  120.     end
  121.